﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Rabbit.Domain.Cultivation;
using Rabbit.Service;

namespace Rabbit.WebApi.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class CultivationController : ControllerBase
    {

        CultivationService res;

        public CultivationController(CultivationService res)
        {
            this.res = res;
        }
        #region 养殖信息

        /// <summary>
        /// 养殖信息
        /// </summary>
        /// <param name="tmid"></param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetCultivationInfo(int tmid)
        {
            return Ok(res.GetCultivationInfo(tmid));
        }
        /// <summary>
        /// 添加或修改养殖信息
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult AddCultivationInfo(CultivationInfo input)
        {
            return Ok(res.AddCultivationInfo(input));
        }


        #endregion

        #region 免疫信息
        /// <summary>
        /// 显示免疫信息
        /// </summary>
        /// <param name="tmid"></param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetImmune(int tmid)
        {
            return Ok(res.GetImmune(tmid));
        }
        /// <summary>
        /// 添加免疫信息
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult AddImmune(Immune input)
        {
            return Ok(res.AddImmune(input));
        }
        /// <summary>
        /// 逻辑删除
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult Del(int ids)
        {
            return Ok(res.Del(ids));
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult UpdImmune(Immune input)
        {
            return Ok(res.UpdImmune(input));
        }


        #endregion

        #region 动检证

        /// <summary>
        /// 添加动检证
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult AddDynamic(Dynamic input)
        {
            return Ok(res.AddDynamic(input));
        }
        /// <summary>
        /// 动检证显示
        /// </summary>
        /// <param name="tmid"></param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetDynamic(int tmid)
        {
            return Ok(res.GetDynamic(tmid));
        }
        /// <summary>
        /// 删除图片
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult DelDynamic(int ids)
        {
            return Ok(res.DelDynamic(ids));
        }

        #endregion

        #region 企业信息

        /// <summary>
        /// 养殖信息
        /// </summary>
        /// <param name="tmid"></param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetEnterprise(int tmid)
        {
            return Ok(res.GetEnterprise(tmid));
        }
        /// <summary>
        /// 添加或修改养殖信息
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult AddEnterprise(Enterprise input)
        {
            return Ok(res.AddEnterprise(input));
        }





        #endregion

        #region 企业图片

        /// <summary>
        /// 添加企业图片
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult AddEnterpriseImg(EnterpriseImg input)
        {
            return Ok(res.AddEnterpriseImg(input));
        }
        /// <summary>
        /// 企业图片
        /// </summary>
        /// <param name="tmid"></param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetEnterpriseImg(int tmid)
        {
            return Ok(res.GetEnterpriseImg(tmid));
        }
        /// <summary>
        /// 删除企业图片
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult DelEnterpriseImg(int ids)
        {
            return Ok(res.DelEnterpriseImg(ids));
        }

        #endregion



    }
}
